package com.alipay.app.groupmeal.standard.http;

import com.alibaba.fastjson.JSONObject;
import com.alipay.app.groupmeal.standard.bean.AliPayResVo;
import com.alipay.app.groupmeal.standard.http.bean.resp.AliOrderDTO;
import com.alipay.app.groupmeal.standard.http.bean.resp.BaseResp;
import com.alipay.app.groupmeal.standard.http.bean.resp.HexiaoOrderModel;
import com.alipay.app.groupmeal.standard.http.bean.resp.QrPayModel;
import com.alipay.app.groupmeal.standard.http.bean.resp.QuerySignResp;
import com.alipay.app.groupmeal.standard.http.bean.resp.Result;
import com.alipay.app.groupmeal.standard.http.bean.resp.WithholdResp;
import com.alipay.app.groupmeal.standard.http.bean.resp.WithholdValidateResp;
import com.alipay.app.groupmeal.standard.offline.bean.FkBean;
import com.alipay.app.groupmeal.standard.offline.bean.SbruanDinnerBean;

import java.util.List;
import java.util.Map;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface ApiService {

//    /**
//     * 代扣
//     *
//     * @param params
//     * @return
//     */
//    @POST("/aliFace/api/gateway.do")
//    Observable<BaseResp<WithholdResp>> withhold(@QueryMap Map<String, Object> params);
//
//    /**
//     * 代扣前校验
//     *
//     * @param params
//     * @return
//     */
//    @POST("/api/gateway.do")
//    Observable<BaseResp<WithholdValidateResp>> withholdValidate(@QueryMap Map<String, Object> params);
//
//    /**
//     * 查询签约号
//     *
//     * @param params
//     * @return
//     */
//    @POST("/api/gateway.do")
//    Observable<BaseResp<QuerySignResp>> querySign(@QueryMap Map<String, Object> params);


    @POST("api/AliFace/cardPay")
    Observable<Result<AliPayResVo>> cardPay(@QueryMap Map<String, Object> params,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);


    @POST("api/AliFace/facePay")
    Observable<Result<AliPayResVo>> facePay(@QueryMap Map<String, Object> params,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);

    @GET("api/AliFace/DeviceSign")
    Observable<Result<String>> deviceSign(@Query("deviceId") String deviceId, @Header("tenantId") String tenantId, @Header("deviceSign") String sign);

    @GET("api/v2/pay/readCard")
    Observable<Result<FkBean>> readCard(@Query("cardSn") String cardSn,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);


    @GET("api/AliFace/sys/downFk")
    Observable<Result<List<FkBean>>> downFk(@Query("time") String time,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);
//
//    @GET("api/AliFace/sys/bmcm")
//    Observable<Result<String>> downBmcm();

    @GET("api/AliFace/sys/downMainpSbruanDinner")
    Observable<Result<List<SbruanDinnerBean>>> downMainpSbruanDinner(@Header("tenantId") String tenantId, @Header("deviceSign") String sign);

    @GET("api/AliFace/Pay/weixin")
    Observable<Result<String>> weixinPay(@Query("authCode") String authCode, @Query("price") String price,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);


    @POST("api/AliFace/upLoadOrder")
    Observable<Result<String>> upLoadOrder(@QueryMap Map<String, Object> params,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);

    @POST("api/AliFace/toQrPay")
    Observable<Result<QrPayModel>> toQrPay(@QueryMap Map<String, Object> params,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);

    @POST("api/AliFace/checkQrOrders")
    Observable<Result<QrPayModel>> checkQrOrders(@QueryMap Map<String, Object> params,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);

    @POST("api/AliFace/cardHexiao")
    Observable<Result<HexiaoOrderModel>> cardHexiao(@QueryMap Map<String, Object> params,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);

    @POST("api/AliFace/hexiao1")
    Observable<Result<AliPayResVo>> hexiao1(@QueryMap Map<String, Object> params,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);


    @POST("api/v2/pay/cardPay")
    @Headers("Accept:application/json")
    Observable<Result<AliPayResVo>> cardPayV2(@Body RequestBody body,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);

    @POST("api/v2/pay/qrPay")
    @Headers("Accept:application/json")
    Observable<Result<AliPayResVo>> qrPayV2(@Body RequestBody body,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);


    @GET("api/v2/pay/checkOrder")
    Observable<Result<JSONObject>> checkOrder(@Query("deviceOrders") String deviceOrders,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);


    @POST("api/v2/pay/facePay")
    @Headers("Accept:application/json")
    Observable<Result<AliPayResVo>> facePayV2(@Body JSONObject params,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);


    @GET("api/v2/order/getCensus")
    Observable<Result<JSONObject>> getCensus(@Query("deviceId") String deviceId,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);

    @GET("api/v2/order/getOder")
    Observable<Result<List<AliOrderDTO>>> getOder(@Query("deviceId") String deviceId,@Header("tenantId") String tenantId, @Header("deviceSign") String sign);
}
